﻿using System.Collections.Generic;
using Dala.Samples.DataAccessLayer;
using System.Linq;

namespace Dala.Samples.BusinessLogicLayer
{
    public partial class ProductBLL 
    {
        public List<Product> GetAllProductPaged(string orderBy = default(string), int startRowIndex = default(int), int maximumRows = default(int))
        {
            if (string.IsNullOrEmpty(orderBy))
                orderBy = "ProductId";

            return this.GetAllProducts().Skip(startRowIndex).Take(maximumRows).ToList();
        }

        public int GetTotalCountOfProductPaged(string orderBy = default(string), int startRowIndex = default(int), int maximumRows = default(int))
        {
            return this.GetAllProducts().Count();
        }
    }
}